#ifndef OBJECT_H_

#define OBJECT_H_

#include "common.h"

class Object{
	public:
		Object() : ref_cnt_(1){}
		virtual ~Object() {}

		void add_reference() {ref_cnt_++;}
		void release() {
			ref_cnt_--;
			if ( ref_cnt_ <= 0 ){
				delete this;
			}
		}
	protected:
		uint32_t ref_cnt_;
};


#endif /* OBJECT_H_ */

